home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xpcom / nsIXPTLoader.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  7KB  |  215 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIXPTLoader.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIXPTLoader_h__
  6. #define __gen_nsIXPTLoader_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. #ifndef __gen_nsILocalFile_h__
  14. #include "nsILocalFile.h"
  15. #endif
  16.  
  17. #ifndef __gen_nsIInputStream_h__
  18. #include "nsIInputStream.h"
  19. #endif
  20.  
  21. /* For IDL files that don't want to include root IDL files. */
  22. #ifndef NS_NO_VTABLE
  23. #define NS_NO_VTABLE
  24. #endif
  25.  
  26. /* starting interface:    nsIXPTLoaderSink */
  27. #define NS_IXPTLOADERSINK_IID_STR "6e48c500-8682-4730-add6-7db693b9e7ba"
  28.  
  29. #define NS_IXPTLOADERSINK_IID \
  30.   {0x6e48c500, 0x8682, 0x4730, \
  31.     { 0xad, 0xd6, 0x7d, 0xb6, 0x93, 0xb9, 0xe7, 0xba }}
  32.  
  33. /**
  34.  * Implement nsIXPTLoaderSink if you want to enumerate the entries in
  35.  * an XPT archive of some kind
  36.  */
  37. class NS_NO_VTABLE nsIXPTLoaderSink : public nsISupports {
  38.  public: 
  39.  
  40.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IXPTLOADERSINK_IID)
  41.  
  42.   /**
  43.      * called by the loader for each entry in the archive
  44.      * @param itemName the name of this particular item in the archive
  45.      * @param index the index of the item inthe archive
  46.      * @param stream contains the contents of the xpt file
  47.      */
  48.   /* void foundEntry (in string itemName, in long index, in nsIInputStream xptData); */
  49.   NS_IMETHOD FoundEntry(const char *itemName, PRInt32 index, nsIInputStream *xptData) = 0;
  50.  
  51. };
  52.  
  53. /* Use this macro when declaring classes that implement this interface. */
  54. #define NS_DECL_NSIXPTLOADERSINK \
  55.   NS_IMETHOD FoundEntry(const char *itemName, PRInt32 index, nsIInputStream *xptData); 
  56.  
  57. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  58. #define NS_FORWARD_NSIXPTLOADERSINK(_to) \
  59.   NS_IMETHOD FoundEntry(const char *itemName, PRInt32 index, nsIInputStream *xptData) { return _to FoundEntry(itemName, index, xptData); } 
  60.  
  61. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  62. #define NS_FORWARD_SAFE_NSIXPTLOADERSINK(_to) \
  63.   NS_IMETHOD FoundEntry(const char *itemName, PRInt32 index, nsIInputStream *xptData) { return !_to ? NS_ERROR_NULL_POINTER : _to->FoundEntry(itemName, index, xptData); } 
  64.  
  65. #if 0
  66. /* Use the code below as a template for the implementation class for this interface. */
  67.  
  68. /* Header file */
  69. class nsXPTLoaderSink : public nsIXPTLoaderSink
  70. {
  71. public:
  72.   NS_DECL_ISUPPORTS
  73.   NS_DECL_NSIXPTLOADERSINK
  74.  
  75.   nsXPTLoaderSink();
  76.  
  77. private:
  78.   ~nsXPTLoaderSink();
  79.  
  80. protected:
  81.   /* additional members */
  82. };
  83.  
  84. /* Implementation file */
  85. NS_IMPL_ISUPPORTS1(nsXPTLoaderSink, nsIXPTLoaderSink)
  86.  
  87. nsXPTLoaderSink::nsXPTLoaderSink()
  88. {
  89.   /* member initializers and constructor code */
  90. }
  91.  
  92. nsXPTLoaderSink::~nsXPTLoaderSink()
  93. {
  94.   /* destructor code */
  95. }
  96.  
  97. /* void foundEntry (in string itemName, in long index, in nsIInputStream xptData); */
  98. NS_IMETHODIMP nsXPTLoaderSink::FoundEntry(const char *itemName, PRInt32 index, nsIInputStream *xptData)
  99. {
  100.     return NS_ERROR_NOT_IMPLEMENTED;
  101. }
  102.  
  103. /* End of implementation class template. */
  104. #endif
  105.  
  106.  
  107. /* starting interface:    nsIXPTLoader */
  108. #define NS_IXPTLOADER_IID_STR "368a15d9-17a9-4c2b-ac3d-a35b3a22b876"
  109.  
  110. #define NS_IXPTLOADER_IID \
  111.   {0x368a15d9, 0x17a9, 0x4c2b, \
  112.     { 0xac, 0x3d, 0xa3, 0x5b, 0x3a, 0x22, 0xb8, 0x76 }}
  113.  
  114. /**
  115.  * The XPT loader interface: implemented by a loader to grab an input
  116.  * stream which will be consumed by the interface loader.
  117.  */
  118. class NS_NO_VTABLE nsIXPTLoader : public nsISupports {
  119.  public: 
  120.  
  121.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IXPTLOADER_IID)
  122.  
  123.   /**
  124.      * enumerate entries in the given archive
  125.      * for each entry found, the loader will call the sink's
  126.      * foundEntry() method with the appropriate information and a
  127.      * stream that the consumer can read from
  128.      * @param file the file to read from
  129.      * @param sink an object which will be called with each file found
  130.      *             in the file
  131.      */
  132.   /* void enumerateEntries (in nsILocalFile file, in nsIXPTLoaderSink sink); */
  133.   NS_IMETHOD EnumerateEntries(nsILocalFile *file, nsIXPTLoaderSink *sink) = 0;
  134.  
  135.   /**
  136.      * Load a specific entry from the archive
  137.      * @param file the file to read from
  138.      * @param name the name of the xpt within the file
  139.      * @return an input stream that will read the raw xpt data from
  140.      *         the file
  141.      */
  142.   /* nsIInputStream loadEntry (in nsILocalFile file, in string name); */
  143.   NS_IMETHOD LoadEntry(nsILocalFile *file, const char *name, nsIInputStream **_retval) = 0;
  144.  
  145. };
  146.  
  147. /* Use this macro when declaring classes that implement this interface. */
  148. #define NS_DECL_NSIXPTLOADER \
  149.   NS_IMETHOD EnumerateEntries(nsILocalFile *file, nsIXPTLoaderSink *sink); \
  150.   NS_IMETHOD LoadEntry(nsILocalFile *file, const char *name, nsIInputStream **_retval); 
  151.  
  152. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  153. #define NS_FORWARD_NSIXPTLOADER(_to) \
  154.   NS_IMETHOD EnumerateEntries(nsILocalFile *file, nsIXPTLoaderSink *sink) { return _to EnumerateEntries(file, sink); } \
  155.   NS_IMETHOD LoadEntry(nsILocalFile *file, const char *name, nsIInputStream **_retval) { return _to LoadEntry(file, name, _retval); } 
  156.  
  157. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  158. #define NS_FORWARD_SAFE_NSIXPTLOADER(_to) \
  159.   NS_IMETHOD EnumerateEntries(nsILocalFile *file, nsIXPTLoaderSink *sink) { return !_to ? NS_ERROR_NULL_POINTER : _to->EnumerateEntries(file, sink); } \
  160.   NS_IMETHOD LoadEntry(nsILocalFile *file, const char *name, nsIInputStream **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->LoadEntry(file, name, _retval); } 
  161.  
  162. #if 0
  163. /* Use the code below as a template for the implementation class for this interface. */
  164.  
  165. /* Header file */
  166. class nsXPTLoader : public nsIXPTLoader
  167. {
  168. public:
  169.   NS_DECL_ISUPPORTS
  170.   NS_DECL_NSIXPTLOADER
  171.  
  172.   nsXPTLoader();
  173.  
  174. private:
  175.   ~nsXPTLoader();
  176.  
  177. protected:
  178.   /* additional members */
  179. };
  180.  
  181. /* Implementation file */
  182. NS_IMPL_ISUPPORTS1(nsXPTLoader, nsIXPTLoader)
  183.  
  184. nsXPTLoader::nsXPTLoader()
  185. {
  186.   /* member initializers and constructor code */
  187. }
  188.  
  189. nsXPTLoader::~nsXPTLoader()
  190. {
  191.   /* destructor code */
  192. }
  193.  
  194. /* void enumerateEntries (in nsILocalFile file, in nsIXPTLoaderSink sink); */
  195. NS_IMETHODIMP nsXPTLoader::EnumerateEntries(nsILocalFile *file, nsIXPTLoaderSink *sink)
  196. {
  197.     return NS_ERROR_NOT_IMPLEMENTED;
  198. }
  199.  
  200. /* nsIInputStream loadEntry (in nsILocalFile file, in string name); */
  201. NS_IMETHODIMP nsXPTLoader::LoadEntry(nsILocalFile *file, const char *name, nsIInputStream **_retval)
  202. {
  203.     return NS_ERROR_NOT_IMPLEMENTED;
  204. }
  205.  
  206. /* End of implementation class template. */
  207. #endif
  208.  
  209. // the first part of the contractID for any loader
  210. // append the type of loader that you need, such as "zip"
  211. #define NS_XPTLOADER_CONTRACTID_PREFIX \
  212.    "@mozilla.org/xptinfo/loader;1&type="
  213.  
  214. #endif /* __gen_nsIXPTLoader_h__ */
  215.